package edu.rpi.cs.android;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;

public class transactionView extends Activity {
	Transactions transa = new Transactions();
    public void onCreate(Bundle icicle) {
        super.onCreate(icicle);
        setContentView(R.layout.listoftrans);
        ListView listtrans = (ListView) findViewById(R.id.translist);
        ArrayAdapter<String> adpt;
        adpt = new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,transa.dispTrans);
        listtrans.setAdapter(adpt);
        
        final Button new_button = (Button)findViewById(R.id.addtrans);

        
        new_button.setOnClickListener(new View.OnClickListener() {
        	public void onClick(View view) {
        			Intent i = new Intent(transactionView.this, newtransaction.class);
        			startActivity(i);
        			
        		}
    });
    }

}
